<include file="Common/header" />
<title>统计图</title>
<script type="text/javascript" src="__PUBLIC__/h-ui/lib/echarts.min.js"></script>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 数据分析
    <span class="c-gray en">&gt;</span> 每月日常费用数据分析
    <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="pd-20">
    <div id="myChart" style="height:400px; width: 800px; float: left; padding-left: 100px;"></div><br />
	<div style="margin-top: 400px; margin-left:100px;">
		<?php echo date('Y年m月', strtotime("-1 month")); ?>日常费用统计：本月应收{$count}户，实收{$count - $uncount}户，欠费{$uncount}户。
		本月应收金额￥{$total}元，实收￥{$account}，欠款￥{$unacount}元。<br />
	</div>
</div>
<script>
    $(document).ready(function(){
        //加载图表  
        var myChart = echarts.init(document.getElementById("myChart"));  
        myChart.setOption({
			title: {
				text: "<?php echo date('m月', strtotime('-1 month'));?>日常费用数据分析（单位:元）",
			},
			tooltip : {
				trigger: 'axis',
				axisPointer : {            // 坐标轴指示器，坐标轴触发有效
					type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				},
				formatter: function (params) {
					var tar = params[1];
					return tar.name + '<br/>' + tar.seriesName + ' : ' + tar.value;
				}
			},
			grid: {
				left: '3%',
				right: '4%',
				bottom: '3%',
				containLabel: true
			},
			xAxis: {
				type : 'category',
				splitLine: {show:false},
				data : ['欠费','实收','应收']
			},
			yAxis: {
				type : 'value'
			},
			series: [
				{
					name: '辅助',
					type: 'bar',
					stack:  '总量',
					itemStyle: {
						normal: {
							barBorderColor: 'rgba(0,0,0,0)',
							color: 'rgba(0,0,0,0)'
						},
						emphasis: {
							barBorderColor: 'rgba(0,0,0,0)',
							color: 'rgba(0,0,0,0)'
						}
					},
					data: [0, {$unacount}, 0]
				},
				{
					name: '日常费用',
					type: 'bar',
					stack: '总量',
					label: {
						normal: {
							show: true,
							position: 'inside'
						}
					},
					data:[{$unacount}, {$account}, {$total}]
				}
			]
        });
    });
</script>